﻿using System;
using System.Text;
using System.Collections.Generic;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using YakShaver.WCSF.BuildManager.Views;

namespace YakShaver.WCSF.BuildManager.Tests
{
    /// <summary>
    /// Summary description for ProjectBuildsPresenterTestFixture
    /// </summary>
    [TestClass]
    public class ProjectBuildsPresenterTestFixture
    {
        public ProjectBuildsPresenterTestFixture()
        {
        }

        #region Additional test attributes
        //
        // You can use the following additional attributes as you write your tests:
        //
        // Use ClassInitialize to run code before running the first test in the class
        // [ClassInitialize()]
        // public static void MyClassInitialize(TestContext testContext) { }
        //
        // Use ClassCleanup to run code after all tests in a class have run
        // [ClassCleanup()]
        // public static void MyClassCleanup() { }
        //
        // Use TestInitialize to run code before running each test 
        // [TestInitialize()]
        // public void MyTestInitialize() { }
        //
        // Use TestCleanup to run code after each test has run
        // [TestCleanup()]
        // public void MyTestCleanup() { }
        //
        #endregion
    }

    class MockProjectBuildsView : IProjectBuildsView
    {

        #region IProjectBuildsView Members

        public int SetProjectBuildsCallCount;
        public List<YakShaver.WCSF.BuildManager.Interface.BusinessEntities.IProjectBuild> _projectBuilds;

        public void SetProjectBuilds(IList<YakShaver.WCSF.BuildManager.Interface.BusinessEntities.IProjectBuild> projectBuilds)
        {
            SetProjectBuildsCallCount++;
            _projectBuilds = (List<YakShaver.WCSF.BuildManager.Interface.BusinessEntities.IProjectBuild>)  projectBuilds;
        }

        #endregion

        #region IProjectBuildsView Members


        public int SetProjectCallCount;
        public int GetProjectCallCount;
        public YakShaver.WCSF.BuildManager.Interface.BusinessEntities.IProject _project;


        public YakShaver.WCSF.BuildManager.Interface.BusinessEntities.IProject Project
        {
            get
            {
                GetProjectCallCount++;
                return _project;
            }
            set
            {
                SetProjectCallCount++;
                _project = value;
            }
        }

        #endregion

        #region IProjectBuildsView Members

        public int GetProjectIdCallCount;
        public string ProjectId
        {
            get { 
                GetProjectIdCallCount++;
                return "123";
            }
        }

        #endregion
    }
}

